package com.styytech.dadabao.api.requestresult;

import com.styytech.dadabao.api.response.AbstractResponseResult;

/**
 * Created by User on 2015/8/3.
 */
public class RegistResult extends RequestResult {
    private Object obj;

    /**
     * 构造函数
     *
     * @param httpResponseResult
     */
    public RegistResult(AbstractResponseResult httpResponseResult) {
        super(httpResponseResult);
    }

    /**
     * @param obj                请求成功后，该对象会被返回
     * @param httpResponseResult
     */
    public RegistResult(Object obj, AbstractResponseResult httpResponseResult) {
        super(httpResponseResult);
        this.obj = obj;
    }

    @Override
    public void doBusiness() {
        super.doBusiness();
        if (isSuccess() && httpResponseResult != null) {
            // 处理成功的逻辑
            httpResponseResult.executeSuccess(obj);
        }
    }
}
